<template>
  <div>
    <el-container>
      <!--侧边栏-->
      <el-aside width= "asideWidth" style=" min-height: 100vh; background-color: #404e65">
        <div style="height: 60px;color: white; line-height: 60px; font-size: 20px; display: flex; align-items: center; justify-content: center">
          <img src="@/assets/logo1.png" style="width: 30px;" alt="">
          <span class="logo-title" v-show="!isCollapse">广绣文化交流网站</span>
        </div>

        <el-menu :collapse="isCollapse" :collapse-transition="false" router background-color="#404e65" text-color="rgba(255, 255, 255, 0.65)" active-text-color="#fff" style="border: none" :default-active="$route.path">
          <el-menu-item index="/">
              <i class="el-icon-menu"></i>
              <span slot="title">系统首页</span>
          </el-menu-item>
          <el-menu-item index="/1">
            <i class="el-icon-pie-chart"></i>
            <span slot="title">仪表板</span>
          </el-menu-item>
          <el-submenu>
            <template slot="title">
              <i class="el-icon-s-grid"></i>
              <span>信息管理</span>
            </template>
            <el-menu-item index="/user" >
              <i class="el-icon-user-solid"></i>
              <span>用户管理</span>
            </el-menu-item>
            <el-menu-item index="/admin">
              <i class="el-icon-s-order"></i>
              <span>内容管理</span>
            </el-menu-item>
            <el-menu-item index="/comment">
              <i class="el-icon-s-comment"></i>
              <span>评论管理</span>
            </el-menu-item>
          </el-submenu>
          <el-menu-item index="/2">
            <i class="el-icon-s-data"></i>
            <span slot="title">数据统计</span>
          </el-menu-item>
          <el-menu-item index="/3">
            <i class="el-icon-s-opportunity"></i>
            <span slot="title">反馈和投诉</span>
          </el-menu-item>
          <el-menu-item index="/4">
            <i class="el-icon-message-solid"></i>
            <span slot="title">公告和通知</span>
          </el-menu-item>
          <el-menu-item index="/5">
            <i class="el-icon-key"></i>
            <span slot="title">安全和权限</span>
          </el-menu-item>

        </el-menu>
      </el-aside>

      <el-container>
        <!--头部-->
        <el-header>
          <i :class="collapseIcon" style="font-size: 26px" @click="handleCollapse"></i>
          <el-breadcrumb separator-class="el-icon-arrow-right" style="margin-left: 20px">
            <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item :to="{ path: '/user' }">用户管理</el-breadcrumb-item>
          </el-breadcrumb>

          <div style="flex: 1; width: 0; display: flex; align-items: center; justify-content: flex-end">
            <i class="el-icon-quanping" style="font-size: 26px" @click="handleFull"></i>
            <el-dropdown placement="bottom">
              <div style="display: flex; align-items: center; cursor: default">
                <img src="@/assets/logo2.png" alt="" style="width: 40px; height: 40px; margin: 0 5px">
                <span>管理员</span>
              </div>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item>个人信息</el-dropdown-item>
                <el-dropdown-item>修改密码</el-dropdown-item>
                <el-dropdown-item @click="">退出登录</el-dropdown-item>
              </el-dropdown-menu>
            </el-dropdown>
          </div>
        </el-header>
        <!--主体-->
        <el-main>
          <el-main>
            <div style="box-shadow: 0 0 10px rgba(0,0,0,.1); padding: 10px 20px; border-radius: 5px; margin-bottom: 10px">
              广绣文化交流网站欢迎您的到来，祝您开心每一天！
            </div>
            <el-card style="width: 500px">
              <div slot="header" class="clearfix">
                <span>广绣文化交流网站</span>
              </div>
              <div>
                主题没想好
                <div style="margin-top: 20px">
                  <div style="margin: 10px 0"><strong>主题色</strong></div>
                  <el-button type="primary">按钮</el-button>
                  <el-button type="success">按钮</el-button>
                  <el-button type="warning">按钮</el-button>
                  <el-button type="danger">按钮</el-button>
                  <el-button type="info">按钮</el-button>
                </div>
              </div>
            </el-card>
          </el-main>
        </el-main>
      </el-container>
    </el-container>

  </div>
</template>

<script>


export default {
  name: 'HomeView',
  data() {
    return {
      isCollapse: false,
      asideWidth: '200px',
      collapseIcon: 'el-icon-d-arrow-left'
    }
  },
  methods: {
    handleCollapse() {
      this.isCollapse = !this.isCollapse
      this.asideWidth = this.isCollapse ? '64px' : '200px'
      this.collapseIcon = this.isCollapse ? 'el-icon-d-arrow-right' : 'el-icon-d-arrow-left'
    }
  }
}
</script>

<style>
  .el-menu--inline {
    background-color: #33425b !important;
  }
  .el-menu--inline .el-menu-item {
    background-color: #33425b !important;
    padding-left: 49px !important;
  }
  .el-menu-item:hover, .el-submenu__title:hover {
    color: white !important;
  }
  .el-submenu__title:hover i {
    color: white !important;
  }
  .el-menu-item:hover i {
    color: white !important;
  }
  .el-menu-item.is-active {
    background-color: #1890ff !important;
    border-radius: 5px !important;
    width: calc(100% - 8px);
    margin-left: 4px;
  }
  .el-menu-item.is-active i, .el-menu-item.is-active .el-tooltip{
    margin-left: -4px;
  }
  .el-menu-item {
    height: 40px !important;
    line-height: 40px !important;
  }
  .el-submenu__title {
    height: 40px !important;
    line-height: 40px !important;
  }
  .el-submenu .el-menu-item {
    min-width: 0 !important;
  }
  .el-menu--inline .el-menu-item.is-active {
    padding-left: 45px !important;
  }

  .el-aside {
    transition: width .3s;
    box-shadow: 2px 0 6px rgba(0,21,41,.35);
  }
  .logo-title {
    margin-left: 5px;
    font-size: 20px;
    transition: all .3s;
  }
  .el-header {
    box-shadow: 2px 0 6px rgba(0,21,41,.35);
    display: flex;
    align-items: center;
  }
</style>
